<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	template="../templates/user_template.xhtml">

	<ui:define name="css-styles">
		<h:outputStylesheet library="css" name="staff.css" />
	</ui:define>

	<ui:define name="title">
		Програма за деня
	</ui:define>

	<ui:define name="content">

		<h:form>
			<h1 align="center" id="program-header" style="color: black;">Добавяне
				на филм и прожекция</h1>
			<p>
				<h:commandButton value="Въведи нова " />
				<h:selectOneMenu value="#{staffBean.type}">
					<f:selectItem itemValue="projection" itemLabel="Прожекция" />
					<f:selectItem itemValue="movie" itemLabel="Филм" selected="true" />
				</h:selectOneMenu>
			</p>
		</h:form>

		<h:panelGroup rendered="#{staffBean.movie}">
			<h2 style="color: black;">Информация за филм:</h2>
			<h:form id="movieForm">
				<table>
					<tr>
						<td>
							<h:outputText value="Име" />
						</td>
						<td>
							<h:inputText id="movieName" value="#{staffBean.moviePojo.name}"
								requiredMessage="*Field is required"
								validatorMessage="*Length is less than allowable minimum of '5'"
								required="true">
								<f:validateLength minimum="5" maximum="25" />
							</h:inputText>
						</td>
						<td>
							<h:message for="movieName" styleClass="warning" />
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Тип" />
						</td>
						<td>
							<h:inputText id="movieType"
								value="#{staffBean.moviePojo.movieType}"
								requiredMessage="*Field is required"
								validatorMessage="*Length is less than allowable minimum of '5'"
								required="true">
								<f:validateLength minimum="5" maximum="25" />
							</h:inputText>
						</td>
						<td>
							<h:message for="movieType" styleClass="warning" />
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Продължителност" />
						</td>
						<td>
							<h:inputText id="movieDuration"
								value="#{staffBean.moviePojo.duration}"
								requiredMessage="*Field is required"
								validatorMessage="*Length is less than allowable minimum of '5'"
								required="true">

							</h:inputText>
						</td>
						<td>
							<h:message for="movieDuration" styleClass="warning" />
						</td>
					</tr>
					<tr>
						<td></td>
						<td style="font-size: 11px">(HH:mm:ss)</td>
						<td></td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Режисьор" />
						</td>
						<td>
							<h:inputText id="movieDirector"
								value="#{staffBean.moviePojo.director}"
								requiredMessage="*Field is required"
								validatorMessage="*Length is less than allowable minimum of '5'"
								required="true">
								<f:validateLength minimum="5" maximum="25" />
							</h:inputText>
						</td>
						<td>
							<h:message for="movieDirector" styleClass="warning" />
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Актьори" />
						</td>
						<td>
							<h:inputText id="movieActors"
								value="#{staffBean.moviePojo.actors}"
								requiredMessage="*Field is required"
								validatorMessage="*Length is less than allowable minimum of '5'"
								required="true">
								<f:validateLength minimum="5" maximum="25" />
							</h:inputText>
						</td>
						<td>
							<h:message for="movieActors" styleClass="warning" />
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Дърважа" />
						</td>
						<td>
							<h:inputText id="movieCountry"
								value="#{staffBean.moviePojo.country}"
								requiredMessage="*Field is required"
								validatorMessage="*Length is less than allowable minimum of '5'"
								required="true">
								<f:validateLength minimum="5" maximum="25" />
							</h:inputText>
						</td>
						<td>
							<h:message for="movieCountry" styleClass="warning" />
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Резюме" />
						</td>
						<td>
							<h:inputText id="movieSummary"
								value="#{staffBean.moviePojo.summary}"
								requiredMessage="*Field is required"
								validatorMessage="*Length is less than allowable minimum of '5'"
								required="true" escape="false">
								<f:validateLength minimum="5" maximum="500" />
							</h:inputText>
						</td>
						<td>
							<h:message for="movieSummary" styleClass="warning" />
						</td>
					</tr>
				</table>
				<h:commandButton value="Добави нов филм"
					action="#{staffBean.insertMovie}"
					style="margin-top: 10px; margin-bottom: 10px;" />
			</h:form>
			<h:outputText value="#{staffBean.warning}" styleClass="warning" />
			<h:outputText value="#{staffBean.message}" styleClass="success" />
		</h:panelGroup>

		<h:panelGroup rendered="#{!staffBean.movie}">
			<h2 style="color: black;">Информация за прожекция:</h2>
			<h:form id="projectionForm">
				<table>
					<tr>
						<td>
							<h:outputText value="Дата, час" />
						</td>
						<td>
							<h:inputText id="projectionTimeStart"
								value="#{staffBean.projection.timeStart}"
								requiredMessage="*Field is required"
								validatorMessage="*Length is less than allowable minimum of '5'"
								required="true">
								<f:validateLength minimum="5" maximum="25" />
							</h:inputText>
						</td>
						<td>
							<h:message for="projectionTimeStart" styleClass="warning" />
						</td>
					</tr>
					<tr>
						<td></td>
						<td style="font-size: 11px">(yyyy-MM-dd HH:mm:ss)</td>
						<td></td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Номер зала" />
						</td>
						<td>
							<h:inputText id="projectionHall"
								value="#{staffBean.projection.hallNumer}"
								requiredMessage="*Field is required"
								validatorMessage="*Length is less than allowable minimum of '1'"
								required="true">
								<f:validateLength minimum="1" maximum="3" />
							</h:inputText>
						</td>
						<td>
							<h:message for="projectionHall" styleClass="warning" />
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Име на филма" />
						</td>
						<td>
							<h:inputText id="movieNamee"
								value="#{staffBean.projection.movieName}"
								requiredMessage="*Field is required"
								validatorMessage="*Length is less than allowable minimum of '5'"
								required="true">

							</h:inputText>
						</td>
						<td>
							<h:message for="movieNamee" styleClass="warning" />
						</td>
					</tr>
				</table>
				<h:commandButton value="Добави нова прожекция"
					action="#{staffBean.insertProjection}"
					style="margin-top: 10px; margin-bottom: 10px;" />
			</h:form>
			<h:outputText value="#{staffBean.warning}" styleClass="warning" />
			<h:outputText value="#{staffBean.message}" styleClass="success" />
		</h:panelGroup>
	</ui:define>
</ui:composition>